home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
perl
/
prlbkxmp.lha
/
ch1
/
findwords
< prev
next >
Wrap
Text File
|
1991-01-07
|
423b
|
22 lines
#!/usr/bin/perl
open(FIND, "find . -print |") || die "Couldn't run find: $!\n";
FILE:
while ($filename = <FIND>) {
chop $filename;
next FILE unless -T $filename;
if (!open(TEXTFILE, $filename)) {
print STDERR "Can't open $filename--continuing...\n";
next FILE;
}
while (<TEXTFILE>) {
foreach $word (@ARGV) {
if (index($_, $word) >= 0) {
print $filename, "\n";
next FILE;
}
}
}
}